﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace Minesweeper.Converter
{
    public class FontSizeConverter : IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            Double height = (Double)values[0];
            Double width = (Double)values[1];

            Double fontSize;
            if (height > width)
            {
                fontSize = width / 1.8;
            }
            else
            {
                fontSize = height / 1.8;
            }
            return fontSize;
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
        {
            return null;
        }
    }
}
